﻿@*@model IEnumerable<Business.DbConnect.Ticket>*@
@model PagedList.IPagedList<Business.DbConnect.Ticket>
@using ServerMotorManagement.Utilities
<table id="rounded-corner">
    <tr>
        <th>
            Tên khách
        </th>
        <th>
            Ngày bắt đầu
        </th>
        <th>
            Ngày hết hạn
        </th>
        <th>
            Biển số xe
        </th>
        <th>
            Loại xe
        </th>
        <th>
            Chú thích
        </th>
        <th>
            Sửa
        </th>
        <th>
            Xóa
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Customer.FullName)
            </td>
            <td>
                @Html.GetDDMMYYYYString(item.StartTime)
            </td>
            <td>
                @Html.GetDDMMYYYYString(item.EndTime)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.MotorbikePlate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Motorbike.MotorType1.Description)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Comment)
            </td>
            <td>
                <a href="#" lId="@item.TicketId" class="editLink"><img src="@Url.Content("~/Content/in-admin-panel/images/user_edit.png")"/></a>
            </td>
            <td>
                 <a href="#"  lId="@item.TicketId" class="deleteLink"><img src="@Url.Content("~/Content/in-admin-panel/images/trash.png")"/></a>
            </td>
        </tr>
    }
</table>
<div>
    Trang @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    / @Model.PageCount
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1, currentFilter = ViewBag.CurrentFilter })
        @Html.Raw(" ");
        @Html.ActionLink("< ", "ListTicket", new { page = Model.PageNumber - 1, currentFilter = ViewBag.CurrentFilter })
    }
   
    @if (Model.HasNextPage)
    {
        @Html.ActionLink(" >", "ListTicket", new { page = Model.PageNumber + 1, currentFilter = ViewBag.CurrentFilter })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount, currentFilter = ViewBag.CurrentFilter })
    }

</div>